import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace BaseinfoChatApi {
  /** 会话信息信息 */
  export interface BaseinfoChat {
    id: number; // 序号
    chatNo: string; // 回话编号
    demandNo?: string; // 需求方
    productNo: string; // 产品方
    demandIndicator: number; // 需求指标
    productLableinfo: boolean; // 产品标签
    demaToProd: boolean; // 是否需求发起
    status: string; // 状态
  }
  export interface BaseinfoChatData {
    id: number; // 序号
    demandNo:number,
    targetNo:number
  }
}

/** 查询会话信息分页 */
export function getBaseinfoChatPage(params: PageParam) {
  return requestClient.get<PageResult<BaseinfoChatApi.BaseinfoChat>>('/csyt/baseinfo-chat/page', { params });
}
// 查询指标匹配
export function getBaseinfoChatInfo(params: PageParam) {
  return requestClient.get<PageResult<BaseinfoChatApi.BaseinfoChat>>('/csyt/baseinfo-chat/getInfo', { params });
}
export function getBaseinfoChatLable(params: PageParam) {
  return requestClient.get<PageResult<BaseinfoChatApi.BaseinfoChatData>>('/csyt/baseinfo-indicator-lableinfo/page', { params });
}
/** 查询会话信息详情 */
export function getBaseinfoChat(id: number) {
  return requestClient.get<BaseinfoChatApi.BaseinfoChat>(`/csyt/baseinfo-chat/get?id=${id}`);
}

/** 新增会话信息 */
export function createBaseinfoChat(data: BaseinfoChatApi.BaseinfoChat) {
  return requestClient.post('/csyt/baseinfo-chat/create', data);
}
// 需求新增
export function createBaseinfoChatadds(data: BaseinfoChatApi.BaseinfoChat) {
  return requestClient.post('/csyt/baseinfo-indicator-lableinfo/adds', data);
}
/** 修改会话信息 */
export function updateBaseinfoChat(data: BaseinfoChatApi.BaseinfoChat) {
  return requestClient.put('/csyt/baseinfo-chat/update', data);
}

/** 删除会话信息 */
export function deleteBaseinfoChat(id: number) {
  return requestClient.delete(`/csyt/baseinfo-chat/delete?id=${id}`);
}

/** 批量删除会话信息 */
export function deleteBaseinfoChatList(ids: number[]) {
  return requestClient.delete(`/csyt/baseinfo-chat/delete-list?ids=${ids.join(',')}`)
}
  export function deleteBaseinfoChatDelete(ids: number[]) {
  return requestClient.delete(`/csyt/baseinfo-indicator-lableinfo/delete-list?ids=${ids.join(',')}`)
}
/** 导出会话信息 */
export function exportBaseinfoChat(params: any) {
  return requestClient.download('/csyt/baseinfo-chat/export-excel', params);
}


